[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
A_MIN()
Return the smallest value found in a given range of an array
-------------------------------------------------------------------------------
Syntax
A_MIN( <aTarget>, [<idxPos>], [<nCount>] )
Arguments
<aTarget> is the numeric type array to evaluate.
<idxPos> is the position in the target array of the first element
to be evaluated. If not specified, A_MIN() begins its search on
the first element in the array.
<nCount> is the number of elements to evaluate. The default is all
elements starting at <idxPos> until the end of the array.
Returns
A_MIN() returns an index to the element which has the minimum
value found in the specified range.
Description
A_MIN() evaluates every element in the specified range of a
numeric type array and returns an index to that element which has
the lowest value.
Examples
// Declare a two dimensional (UI)nteger array
LOCAL rows, cols, x
rows = 10
cols = 20
auInteger = A_DECLARE( "UI", rows, cols )
// Fill the second row of the array with increasing
// integer values 1 - 20
FOR x = 1 to 20
A_STORE( auInteger, x, A_( 2, x ) )
NEXT
// Fetch the minimum value in the first half of the
// second row.
? A_MIN( auInteger, A_( 2, 1 ), cols / 2 ) // Result: 1
See Also:
A_MAX()
A_SCAN()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson